/*
 * @Author: Songjq
 * @Date: 2022-03-14 20:34:18
 * @Desscription: 短信管理模块
 */
import request from "@/api/request";

// 发送手机验证码
export function sendPhoneCode(data) {
    return request({
        url: "api/sms/sendCode",
        method: "post",
        data
    });
}

// 发送模板短信
export function sendMessage(data) {
    return request({
        url: "api/sms/sendMessage",
        method: "post",
        data
    });
}

// 下载短信模板
export function getDownTemplate() {
    return request({
        url: "api/sms/downTemplate",
        method: "get",
        responseType: "blob"
    });
}

/**
 * 短信模板管理-------------------start--------------------
 */

// 新增短信模板
export function postSmsTemplate(data) {
    return request({
        url: "api/sms/template",
        method: "post",
        data
    });
}

// 短信模板列表
export function getSmsTemplateAll(params) {
    return request({
        url: "api/sms/template/all",
        method: "get",
        params
    });
}

// 查询短信模板详情
export function getSmsTemplate(params) {
    return request({
        url: "api/sms/template",
        method: "get",
        params
    });
}

// 批量删除数据
export function delSmsTemplate(data) {
    return request({
        url: "api/sms/template/del",
        method: "post",
        data
    });
}

/**
 * 发送记录管理-------------------start--------------------
 */
// 发送记录列表
export function getSmsSendRecordAll(params) {
    return request({
        url: "api/sms/sendRecord/all",
        method: "get",
        params
    });
}
// 批量删除发送记录
export function delSmsSendRecord(data) {
    return request({
        url: "api/sms/sendRecord/del",
        method: "post",
        data
    });
}

/**
 * 发送回执管理-------------------start--------------------
 */
// 发送回执列表
export function getSmsReturnRecordAll(params) {
    return request({
        url: "api/sms/returnRecord/all",
        method: "get",
        params
    });
}
// 批量删除发送回执
export function delSmsReturnRecord(data) {
    return request({
        url: "api/sms/returnRecord/del",
        method: "post",
        data
    });
}

// 批量获取短信状态报告、上行短信信息接口
export function getArrived(data) {
    return request({
        url: "api/sms/getArrived",
        method: "post",
        data
    });
}

export default {
    sendPhoneCode,
    sendMessage,
    getArrived,
    getDownTemplate,
    postSmsTemplate,
    getSmsTemplateAll,
    getSmsTemplate,
    delSmsTemplate,
    getSmsSendRecordAll,
    delSmsSendRecord,
    getSmsReturnRecordAll,
    delSmsReturnRecord

};